<%@ page pageEncoding="UTF-8"%>
<%@ include file="/common/validate.jsp"%>
<%@ include file="function.jsp"%>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>首页轮播排序</title>
    <link  href="../images/favicon.ico?cache=<%=Math.random()%>" rel="shortcut icon" type="image/x-icon">
    <link rel="stylesheet" href="../css/public.css?cache=<%=Math.random()%>">
    <link rel="stylesheet" href="../css/messages_doctor_mes.css?cache=<%=Math.random()%>">
    <link rel="stylesheet" href="../css/sweetalert.css?cache=<%=Math.random()%>" >
    <script src="../js/jquery-1.9.1.min.js"></script>

</head>
<body>
<%@ include file="../header.jsp"%>
<!--内容-->
<div class="containerone">
    <%@ include file="../left_menu.jsp"%>
    <!--右边内容-->
    <div class="right_cont" id='feedback_box'>
        <!--右边导航下面内容-->
        <div class="message_hos_news_container">
            <div class="department_detail ui_padding_top" id="doctor_detail">
                <table class="department_detail_table">
                    <tr class='department_detail_tittle'>
                        <th class='ui_width_s'>序号</th>
                        <th class='ui_widthone'>版本</th>
                        <th class='ui_widther'>反馈内容</th>
                        <th class='ui_widthone'>图片</th>

                    </tr>
                    <template  v-for="feedback in feedbacks ">
                        <tr class="department_detail_home_news">
                            <td v-html="feedback.id"></td>
                            <td v-html="(feedback.app_type == 'patient' ? '公众版' : '其他')+ ': ' + (feedback.device == 0 ? '苹果系统' : feedback.device == 1 ? '安卓' : '微信')+  'v' + feedback.version "></td>

                            <td v-html="limitnumber(feedback.suggestion)" title=""></td>
                            <td class="hospital_news_order" align="center" valign="middle">
                                <img v-bind:src="feedback.imgs">
                            </td>

                        </tr>
                    </template>
                </table>
            </div>
        </div>
    </div>
</div>
<script src="../js/sweetalert-dev.js"></script>
<script>
    new Vue({
        el:"#feedback_box",
        data:{
            feedbacks:[]
        },
        ready:function(){
            var self = this;
            $.ajax({
                type: 'post',
                url: "feedback.jsp",
                data: {
                    act:"showFeedback",
                },
                timeout: 3000,
                dataType: 'json',
                success: function(res) {
                    console.log(res);
                    if (res.errcode == 0) {
                        self.feedbacks= res.data;
                    }
                },
                error: function(error) {

                }
            });
        },
        methods:{
            limitnumber:function(txt) {
                if(txt.length>8){
                    txt = txt.substr(0,8) + '......' ;
                    return txt;
                }
                else{
                    return txt;
                }

            },


        }

    })
</script>
</body>
</html>
